using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TestSystem.BLL.TestSystem;

public partial class SubjectDetails : System.Web.UI.Page
{
    private int subjectID = -1;
    public int SubjectID
    {
        get
        {
            if (subjectID == -1)
                subjectID = int.Parse(Request.QueryString["subjectID"]);
            return subjectID;
        }
    }

    private Subject currentSubject = null;
    public Subject CurrentSubject
    {
        get
        {
            if (currentSubject == null)
                currentSubject = Subject.GetBySubjectID(SubjectID);
            return currentSubject;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            lblName.Text = CurrentSubject.SubjectName;
            lblDescription.Text = CurrentSubject.Description;
            quizesPanel.SubjectID = SubjectID;
        }
    }
}
